package my.graduation.controller.common;

import my.graduation.dto.QueueDto;
import my.graduation.entity.Patient;
import my.graduation.entity.RegistrationRecord;
import my.graduation.result.Result;
import my.graduation.service.ExaminationRecordService;
import my.graduation.service.RegistrationRecordService;
import my.graduation.vo.ExaminationRecordVO;
import my.graduation.vo.RegistrationRecordVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.List;
import java.util.Queue;

/**
 * @Author: RavenLyn
 * @Date: 2024-12-23
 */
@RestController
@RequestMapping
public class QueueController {

    @Autowired
    private RegistrationRecordService regRecordService;

    @Autowired
    private ExaminationRecordService examRecordService;

    /**
     * 医生获取当天当班次的挂号队列
     * @param dto
     * @return
     */
    @PostMapping("/doctor/reg_queue")
    public Result<List<Queue<RegistrationRecordVO>>> getRegQueues(@RequestBody QueueDto dto) {
        return regRecordService.getQueues(dto);
    }

    /**
     * 医生获取当天当班次的检查队列
     * @param dto
     * @return
     */
    @PostMapping("/doctor/exam_queue")
    public Result<List<Queue<ExaminationRecordVO>>> getExamQueues(@RequestBody QueueDto dto) {
        return examRecordService.getQueues(dto);
    }
}
